<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/view/common/common.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>Hiring-发布职位</title>
		<link rel="stylesheet"
			href="${ctx }/vendor/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
		<style>
			.n-right .msg-wrap {
				margin-left: 0 !important;
			}
			
			.topbar {
				position: absolute;
				right: 100px;
				top: 28px;
			}
			
			.topbar ul li {
				list-style: none;
				float: left;
				padding: 0 5px;
			}
			#salary1,
			#salary2,
			#salary3,
			#salary4{
				width:423px;
				float:left;
			}
			#salary5{
				float:left;
				width:100px;
				hight:35px;
				text-align:center;
				position: relative;
				left: 14px;
				font-size:24px;
			}
		</style>
	</head>
	<body>
		<h2 class="text-center">发布职位</h2>
		<div class="topbar">
			<ul>
			    <li><a
					href="${ctx }/company_positionListAll.action">返回	</a></li>
				<li><a
					href="${ctx }/position_listAll.action">招聘首页</a></li>
			</ul>
		</div>
		<hr>
	
		<div class="container">
			<form id="positionReleaseForm" class="form-horizontal"
				action="${ctx }/position_addposition.action"
				method="post" data-validator-option="{timely:2}">
				<input type="hidden" name="position.companyId"  value="${company.id }"/>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label" >职位名称：</label>
					<div class="col-sm-10">
						<input type="text" class="form-control" name="position.name" id="position.name"
							value="${position.name }">
					</div>
				</div>
				<div class="form-group">
					<label for="salary1" class="col-sm-2 control-label">薪资范围：</label>
					<div class="col-sm-10" id="salary3">
						<input type="text" class="form-control" name="position.salary1" id="salary1"
							value="${position.salary1 }"data-rule="required;digits;">
					</div>
					<div id="salary5"><b>~</b></div>
					<div class="col-sm-10"id="salary4">
						<input type="text" class="form-control" name="position.salary2" id="salary2"
							value="${position.salary2 }" data-rule="required;digits;">
					</div>
				</div>
				<div class="form-group">
					<label for="duty" class="col-sm-2 control-label">职责说明：</label>
					<div class="col-sm-10">
						<textarea rows="5" class="form-control" name="position.duty" id="duty"
							 data-rule="required;">${position.duty}</textarea> 
					</div>
				</div>
				<div class="form-group">
					<label for="ability" class="col-sm-2 control-label">能力要求：</label>
					<div class="col-sm-10">
						<textarea rows="5" class="form-control" name="position.ability" id="ability"
							data-rule="required;">${position.ability }</textarea> 
					</div>
				</div>
				
				
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-primary btn-block" id="submit">确认</button>
				</div>
			</form>
		</div>
		<script src="${ctx }/vendor/jquery.min.js"></script>
		<script src="${ctx }/vendor/layer/layer.js"></script>
		<script
			src="${ctx }/vendor/nice-validate-1.1.2/jquery.validator.min.js?local=zh-CN">
			</script>
		<script >
	 	  $('#positionReleaseForm').validator({
		   	    fields: {
		   	        'position.name': {
		   	        	rule: 'required;remote(${ctx}/position_checkPositionName.action)',
		   	         	tip: '请输入具体的职位！',
		   	        	'true': '职位可发布！',
		   		   		dataFilter: function(data) {
		   		   			if (data == 'true') {
		   		   				return '';	
		   		   			} 
		   		   			return '职位已发布';
		   		   	    }
		   	        }
		   	    }
		   	  });
		</script>
	</body>
</html>